package com.example.mvvm.base.vm.action;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import sion.my.netmanger2.enums.NetMode;

public interface ViewModelLife extends LifecycleObserver {
    /**
     * 初始化
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    void initViewModel() ;

    /**
     * 销毁
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    void onDestroy();

    /**
     * 开始
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    void onStart();

    /**
     * 停止
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    void onStop();

    /**
     * 运行
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    void onResume();

    /**
     * 暂停
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    void onPause();

    /**
     * 网络状态改变
     */
    void netWorkChange(NetMode netWorkEvent);

}
